package chixing.day09.work1;

public class Mainboard {
    private VideoCard videoCard;
    private Cpu cpu;

    public Mainboard(VideoCard videoCard, Cpu cpu) {
        this.videoCard = videoCard;
        this.cpu = cpu;
    }

    public void run() {
        System.out.println("Mainboard is running");
        cpu.cpuRunning();
        videoCard.videoRunning();
    }

    // 显示主板停止信息
    public void close() {
        System.out.println("Mainboard is closed");
        // 关闭CPU和显卡
        cpu.cpuClosing();
        videoCard.videoClosing();
    }
}
